<!-- 首页内容 -->
<script setup lang="ts">
import {PropType, reactive, ref} from "vue";
import {UserType} from "@/views/type_f";

type typez = ('a' | 'b')[]
const listz = ref([{
  name: '11'
}])
const detailData = ref<{}>({})
const formData = reactive<{name: string}>({name: ''})
const emits = defineEmits([
  // 更新绑定值
  'update:modelValue',
  // 提交
  'submit'
])

defineProps({
  // 绑定值
  modelValue: String,
  // 类型
  type: String as PropType<'name' | 'sex'>,
  // 类型名称
  typeName: {
    type: String as PropType<'name'>
  },
  // 类型2
  // @options name,sex
  typeName2: String as PropType<string>,
  typeNum: Number as PropType<2>,
  typeNums: Number as PropType<2|3>,
  typeList: Array as PropType<string[]>,
  typeList2: Array as PropType<('e' | 'f')[]>,
  typeRef: Array as PropType<typez>,
  isTag: Boolean as PropType<true>,
  isTag2: Boolean as PropType<boolean>,
  query: {
    type: Function,
    default: () => {
      return () => {
      }
    }
  },
  user: Object as PropType<UserType>
})

function setType(type: string) {

}

function setName(name: string) {

}

defineExpose({
  // 设置类型
  setType,
  // 设置名称
  setName
})
</script>

<template>
  <div>
    <slot></slot>
    <slot name="type"></slot>
    <slot name="list" :list="listz"></slot>
  </div>
</template>

<style scoped lang="scss">

</style>
